/**Variable**/
@import './helpers/mixin.scss';

.vxe-modal--wrapper {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  font-size: $vxe-font-size;
  color: $vxe-font-color;
  font-family: $vxe-font-family;
  transition: top .4s;
  &.active {
    display: block;
  }
  &.is--visible {
    &.is--mask {
      &:before {
        background-color: rgba(0, 0, 0, 0.5);
      }
    }
    &.type--message {
      .vxe-modal--box {
        transform: translateY(0);
      }
    }
    .vxe-modal--box {
      opacity: 1;
      visibility: visible;
    }
  }
  &:not(.lock--view) {
    pointer-events: none;
  }
  &.lock--scroll {
    overflow: hidden;
  }
  &:not(.lock--scroll) {
    overflow: auto;
  }
  &.lock--view,
  &.is--mask {
    &:before {
      content: "";
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: -1;
      pointer-events: auto;
    }
  }
  &.is--mask {
    &:before {
      background-color: rgba(0, 0, 0, 0);
    }
  }
  &.is--animat {
    &.is--mask {
      &:before {
        @include animatTransition(background-color, .2s);
      }
    }
    &.type--message {
      .vxe-modal--box {
        &:not(.is--drag) {
          @include animatTransition(all, .2s, ease-out);
        }
      }
    }
  }
  &.size--small,
  &.size--mini {
    font-size: 12px;
    .vxe-modal--box {
      padding: 6px 0;
    }
    .vxe-modal--body {
      padding: 4px 14px 10px 14px;
    }
    .vxe-modal--footer {
      padding: 4px 14px 8px 14px;
    }
    .vxe-modal--header {
      font-size: 14px;
      padding: 6px 30px 8px 14px;
    }
    .vxe-modal--zoom-btn,
    .vxe-modal--close-btn {
      font-size: 16px;
      top: 10px;
    }
  }
  &.type--message,
  &.type--alert,
  &.type--confirm {
    .vxe-modal--body {
      white-space: normal;
      word-break: break-word;
    }
  }
  &.type--message {
    text-align: center;
    .vxe-modal--box {
      display: inline-block;
      padding: 2px 0;
      margin-top: 0;
      width: auto;
      box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.1);
      transform: translateY(-10%);
      .vxe-modal--body {
        &:after {
          content: '';
          display: block;
          clear: both;
          height: 0;
          overflow: hidden;
          visibility: hidden;
        }
      }
      .vxe-modal--content {
        max-width: 800px;
        float: left;
      }
    }
    .vxe-modal--status-wrapper {
      font-size: 1.4em;
      padding-right: 10px;
    }
  }
  &.type--modal,
  &.type--alert,
  &.type--confirm {
    .vxe-modal--box {
      display: flex;
      flex-direction: column;
      position: absolute;
      left: 50%;
      top: 15vh;
      box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.2);
      border: 1px solid rgba(0,0,0,.2);
      .vxe-modal--header {
        cursor: move;
      }
    }
  }

  &.type--modal {
    .vxe-modal--body {
      overflow: auto;
      .vxe-modal--content {
        overflow: auto;
      }
    }
  }
  &.type--alert,
  &.type--confirm {
    .vxe-modal--status-wrapper {
      font-size: 1.6em;
      padding: 0 10px 0 2px;
    }
  }
  .vxe-modal--box {
    visibility: hidden;
    width: 420px;
    background-color: #fff;
    border-radius: 4px;
    border: 1px solid #ebeef5;
    font-size: 14px;
    text-align: left;
    pointer-events: auto;
    opacity: 0;
    &.is--drag {
      cursor: move;
     .vxe-modal--body,
     .vxe-modal--footer {
        &:after {
          content: "";
          position: absolute;
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
        }
      }
      .vxe-modal--body {
        overflow: hidden;
        .vxe-modal--content {
          overflow: hidden;
        }
      }
    }
  }
  &.status--info {
    .vxe-modal--status-wrapper {
      color: #2998FF;
    }
  }
  &.status--warning,
  &.status--question {
    .vxe-modal--status-wrapper {
      color: #FAAD14;
    }
  }
  &.status--success {
    .vxe-modal--status-wrapper {
      color: #52C41A;
    }
  }
  &.status--error {
    .vxe-modal--status-wrapper {
      color: #F5222D;
    }
  }
  &.status--loading {
    .vxe-modal--status-wrapper {
      color: #78B1EB;
    }
  }
  .vxe-modal--status-wrapper {
    flex-shrink: 0;
    display: flex;
    align-items: center;
  }
  .vxe-modal--content {
    flex-grow: 1;
  }
  .vxe-modal--header,
  .vxe-modal--body,
  .vxe-modal--footer {
    position: relative;
  }
  .vxe-modal--body {
    display: flex;
    flex-grow: 1;
    padding: 10px 16px 12px 16px;
  }
  .vxe-modal--header {
    flex-shrink: 0;
    font-size: 16px;
    font-weight: 700;
    padding: 10px 40px 8px 16px;
    border-bottom: 1px solid #eee;
    background-color: $vxe-modal-header-background-color;
    border-radius: 2px 2px 0 0;
    user-select: none;
    .vxe-icon--zoomin,
    .vxe-icon--zoomout:after {
      background-color: $vxe-modal-header-background-color;
    }
  }
  .vxe-modal--zoom-btn,
  .vxe-modal--close-btn {
    font-size: 18px;
    position: absolute;
    right: 14px;
    top: 12px;
    z-index: 1;
    color: $vxe-table-column-icon-border-color;
    cursor: pointer;
    &:hover {
      color: $vxe-font-color;
    }
  }
  .vxe-modal--zoom-btn {
    right: 44px;
    border-color: $vxe-table-column-icon-border-color;
    &:hover {
      border-color: $vxe-font-color;
    }
  }
  .vxe-modal--footer {
    flex-shrink: 0;
    text-align: right;
    padding: 6px 16px 10px 16px;
  }
  &.is--maximize {
    .vxe-modal--box {
      .vxe-modal--header {
        cursor: default;
      }
    }
    .vxe-modal--resize {
      .wl-resize,
      .wr-resize,
      .swst-resize,
      .sest-resize,
      .st-resize,
      .swlb-resize,
      .selb-resize,
      .sb-resize {
        display: none;
      }
    }
  }
  .vxe-modal--resize {
    $SpaceSize: 8;
    .wl-resize,
    .wr-resize,
    .swst-resize,
    .sest-resize,
    .st-resize,
    .swlb-resize,
    .selb-resize,
    .sb-resize {
      position: absolute;
      z-index: 100;
    }
    .wl-resize,
    .wr-resize {
      width: #{$SpaceSize}px;
      height: 100%;
      top: 0;
      cursor: w-resize;
    }
    .wl-resize {
      left: -#{$SpaceSize / 2 + 1}px;
    }
    .wr-resize {
      right: -#{$SpaceSize / 2 + 1}px;
    }
    .swst-resize,
    .sest-resize,
    .swlb-resize,
    .selb-resize {
      width: #{$SpaceSize + 2}px;
      height: #{$SpaceSize + 2}px;
      z-index: 101;
    }
    .swst-resize,
    .sest-resize {
      top: -#{$SpaceSize}px;
    }
    .swlb-resize,
    .selb-resize {
      bottom: -#{$SpaceSize}px;
    }
    .sest-resize,
    .swlb-resize {
      cursor: sw-resize;
    }
    .swst-resize,
    .selb-resize {
      cursor: se-resize;
    }
    .swst-resize,
    .swlb-resize {
      left: -#{$SpaceSize}px;
    }
    .sest-resize,
    .selb-resize {
      right: -#{$SpaceSize}px;
    }
    .st-resize,
    .sb-resize {
      width: 100%;
      height: #{$SpaceSize}px;
      left: 0;
      cursor: s-resize;
    }
    .st-resize {
      top: -#{$SpaceSize / 2 + 1}px;
    }
    .sb-resize {
      bottom: -#{$SpaceSize / 2 + 1}px;
    }
  }
}